package 笔试记录.M8day7米哈游;

import java.util.Scanner;

public class Main2 {
    //回溯算法
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = sc.nextInt();
        while(count-- > 0){
            System.out.println(solve(sc.nextInt()));
        }
    }

    public static int solve(int n){
        if(n == 2) return 2;
        int res = 0;
        int key = 1;
        int count = 0;
        while(res < n){
            res += key;
            key++;
            count++;
        }
        return n - key + count;
    }
}
